//
//  ViewController.m
//  10508Tom猫
//
//  Created by student on 16/2/20.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *imageView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)drink:(id)sender
{
    //创建图片数组
    NSMutableArray *mArr = [[NSMutableArray alloc]init];
    for (int i=0; i<=80; i++)
    {
        NSString *picName = [NSString stringWithFormat:@"drink_%02i",i];
        UIImage *image = [UIImage imageNamed:picName];
        [mArr addObject:image];
    }
     // 设定图片视图播放图片数组
        self.imageView.animationRepeatCount = 1;
        self.imageView.animationImages = mArr;
        self.imageView.animationDuration = 5;
        [self.imageView startAnimating];
    
}
- (IBAction)cymbal:(id)sender
{
    NSMutableArray *mArr = [[NSMutableArray alloc]init];
    for (int i=0; i<=12; i++)
    {
        NSString *picName = [NSString stringWithFormat:@"cymbal_%02i",i];
        UIImage *image = [UIImage imageNamed:picName];
        [mArr addObject:image];
    }
    self.imageView.animationRepeatCount = 1;
    self.imageView.animationImages = mArr;
    self.imageView.animationDuration = 1;
    [self.imageView startAnimating];
}
- (IBAction)eat:(id)sender
{
    NSMutableArray *mArr = [[NSMutableArray alloc]init];
    for (int i=0; i<=39; i++)
    {
        NSString *picName = [NSString stringWithFormat:@"eat_%02i",i];
        UIImage *image = [UIImage imageNamed:picName];
        [mArr addObject:image];
    }
    self.imageView.animationRepeatCount = 1;
    self.imageView.animationImages = mArr;
    self.imageView.animationDuration = 3;
    [self.imageView startAnimating];
}
- (IBAction)fart:(id)sender
{
    NSMutableArray *mArr = [[NSMutableArray alloc]init];
    for (int i=0; i<=27; i++)
    {
        NSString *picName = [NSString stringWithFormat:@"fart_%02i",i];
        UIImage *image = [UIImage imageNamed:picName];
        [mArr addObject:image];
    }
    self.imageView.animationRepeatCount = 1;
    self.imageView.animationImages = mArr;
    self.imageView.animationDuration = 2.5;
    [self.imageView startAnimating];
}
- (IBAction)pie:(id)sender
{
    NSMutableArray *mArr = [[NSMutableArray alloc]init];
    for (int i=0; i<=23; i++)
    {
        NSString *picName = [NSString stringWithFormat:@"pie_%02i",i];
        UIImage *image = [UIImage imageNamed:picName];
        [mArr addObject:image];
    }
    self.imageView.animationRepeatCount = 1;
    self.imageView.animationImages = mArr;
    self.imageView.animationDuration = 2;
    [self.imageView startAnimating];
}
- (IBAction)scratch:(id)sender
{
    NSMutableArray *mArr = [[NSMutableArray alloc]init];
    for (int i=0; i<=55; i++)
    {
        NSString *picName = [NSString stringWithFormat:@"scratch_%02i",i];
        UIImage *image = [UIImage imageNamed:picName];
        [mArr addObject:image];
    }
    self.imageView.animationRepeatCount = 1;
    self.imageView.animationImages = mArr;
    self.imageView.animationDuration = 3.5;
    [self.imageView startAnimating];
}
- (IBAction)knockout:(id)sender
{
    NSMutableArray *mArr = [[NSMutableArray alloc]init];
    for (int i=0; i<=80; i++)
    {
        NSString *picName = [NSString stringWithFormat:@"knockout_%02i",i];
        UIImage *image = [UIImage imageNamed:picName];
        [mArr addObject:image];
    }
    self.imageView.animationRepeatCount = 1;
    self.imageView.animationImages = mArr;
    self.imageView.animationDuration = 5.5;
    [self.imageView startAnimating];
}
- (IBAction)angry:(id)sender
{
    NSMutableArray *mArr = [[NSMutableArray alloc]init];
    for (int i=0; i<=25; i++)
    {
        NSString *picName = [NSString stringWithFormat:@"angry_%02i",i];
        UIImage *image = [UIImage imageNamed:picName];
        [mArr addObject:image];
    }
    self.imageView.animationRepeatCount = 1;
    self.imageView.animationImages = mArr;
    self.imageView.animationDuration = 2;
    [self.imageView startAnimating];
}
- (IBAction)stomac:(id)sender
{
    NSMutableArray *mArr = [[NSMutableArray alloc]init];
    for (int i=0; i<=33; i++)
    {
        NSString *picName = [NSString stringWithFormat:@"stomach_%02i",i];
        UIImage *image = [UIImage imageNamed:picName];
        [mArr addObject:image];
    }
    self.imageView.animationRepeatCount = 1;
    self.imageView.animationImages = mArr;
    self.imageView.animationDuration = 2.5;
    [self.imageView startAnimating];
}
- (IBAction)left:(id)sender
{
    NSMutableArray *mArr = [[NSMutableArray alloc]init];
    for (int i=0; i<=29; i++)
    {
        NSString *picName = [NSString stringWithFormat:@"footRight_%02i",i];
        UIImage *image = [UIImage imageNamed:picName];
        [mArr addObject:image];
    }
    self.imageView.animationRepeatCount = 1;
    self.imageView.animationImages = mArr;
    self.imageView.animationDuration = 2.5;
    [self.imageView startAnimating];
}
- (IBAction)right:(id)sender
{
    NSMutableArray *mArr = [[NSMutableArray alloc]init];
    for (int i=0; i<=29; i++)
    {
        NSString *picName = [NSString stringWithFormat:@"footLeft_%02i",i];
        UIImage *image = [UIImage imageNamed:picName];
        [mArr addObject:image];
    }
    self.imageView.animationRepeatCount = 1;
    self.imageView.animationImages = mArr;
    self.imageView.animationDuration = 2.5;
    [self.imageView startAnimating];
}

@end
